<template>
	<view>
		<uni-titles :title="'管地基'"></uni-titles>
		<uni-tudwhere></uni-tudwhere>
		<uni-farmtitle :title="'我的农场'" :num="'22'" serchShow @isshow="show = !show"></uni-farmtitle>
		<uni-serchs v-if="show"></uni-serchs>
		<uni-menu :list="menulist" @mchange="mchange"></uni-menu>
		<uni-farmlist2 :list="farmlist" @itemClick="itemClick" :rightText="'查看土地详情'" :rightTextColor="'#8DD16B'">
			<template #one={data}>
				<view class="btnbox mar-top20">
					<view class="btnitem">
						<u-button @click="goguan(data)" text="管地基" type="success" size="small"></u-button>
					</view>
					<view class="btnitem">
						<u-button @click="gofeng" v-if="data.isfeng" text="去丰收" type="success" size="small"></u-button>
						<u-button v-else="data.isfeng" text="去丰收" color="#C2C8BF" size="small"></u-button>
					</view>
					
					
				</view>
			</template>
		</uni-farmlist2>
		<uni-more></uni-more>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				menulist: [{
					name: '大棚',
					num: 12
				}, {
					name: '果园',
					num: 13
				}, {
					name: '大田',
					num: 16
				}],
				menuact: 0,
				farmlist: [{
						name: '番茄',
						type: 5,
						zd: 5.2,
						day: 62,
						where: '荷花池小花园',
						time: '一周前',
						img: ''
					},
					{
						name: '西瓜',
						type: 1,
						zd: 18.1,
						day: 62,
						where: '天府广场小花园',
						time: '两天前',
						isfeng:true,
						img: ''
					},
					{
						name: '番茄',
						type: 2,
						zd: 5,
						day: 62,
						where: '清水河小区',
						time: '三天前',
						img: ''
					}
				],
			};
		},
		methods: {
			mchange(index) {
				this.menuact = index
			},
			goguan(){
				uni.navigateTo({
					url:'/subpkg/foundation/foundationDetail'
				})
			},gofeng(){
				uni.showToast({
					title:'去丰收',
					icon:'none'
				})
			}
		}
	}
</script>

<style lang="scss">
	.btnbox {
		// display: flex;
		// min-width: 150rpx;
		.btnitem{
			display: inline-block;
			margin-right: 32rpx;
		}
	}
</style>
